<!DOCTYPE html>
<html>
<head>
<title>mapp</title>
<meta http-equiv="imagetoolbar" content="no"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<style type="text/css">
html, body { margin:0; padding: 0; height: 100%; width: 100%; }
body { width:100%; height:100%; background: #ffffff; }
#map { position: absolute; height: 100%; width: 100%; background-color: #FFFFFF; }
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.8.2/ol.min.css" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.8.2/ol.min.js" type="text/javascript"></script>
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
var mapExtent = [0.000000, -6068.000000, 8858.000000, 0.000000];
var mapMinZoom = 0;
var mapMaxZoom = 6;
var mapMaxResolution = 1.000000;
var tileExtent = [0.000000, -6068.000000, 8858.000000, 0.000000];

var mapResolutions = [];
for (var z = mapMinZoom; z <= mapMaxZoom; z++) {
  mapResolutions.push(Math.pow(2, mapMaxZoom - z) * mapMaxResolution);  
}

var mapTileGrid = new ol.tilegrid.TileGrid({
  extent: tileExtent,
  minZoom: mapMinZoom,
  resolutions: mapResolutions
});

var map = new ol.Map({
  target: 'map',
  layers: [
    new ol.layer.Tile({
      source: new ol.source.XYZ({
        projection: 'PIXELS',
        tileGrid: mapTileGrid,
        url: "{z}/{x}/{y}.png"
      })
    })
  ],
  view: new ol.View({
    projection: ol.proj.get('PIXELS'),
    extent: mapExtent,
    maxResolution: mapTileGrid.getResolution(0)
  })
});
map.getView().fit(mapExtent, map.getSize());
</script>
</body>
</html>
